package com.leet.competition;

public class CheckWords {
    public boolean isPrefixString(String s, String[] words) {
        StringBuilder s1  = new StringBuilder();
        for(String word: words){
            s1.append(word);
            if(!s.startsWith(s1.toString())){
                return false;
            }
            if(s.equals(s1.toString())){
                return true;
            }
        }
        return false;
    }
}
